﻿using Newtonsoft.Json;
using Utils.FileFolderModule;

namespace Utils.JsonModule
{
    public static class JsonHandler
    {
        public static T GetObjectFromJson<T>(string jsonFilePath)
        {
            return JsonConvert.DeserializeObject<T>(FileHandler.ReadFileContent(jsonFilePath));
        }

        public static string GetJsonFromObject<T>(T obj)
        {
            return JsonConvert.SerializeObject(obj, Formatting.Indented);
        }
    }
}